package com.relife.core.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;

import com.relife.common.utils.StringUtil;
import org.hibernate.annotations.GenericGenerator;



@MappedSuperclass
public class ProcessEntity implements Serializable {
	private static final long serialVersionUID = 3477089705167049022L;
	private String id;
	/** 创建时间 **/
	private Date createDate;
	/** 最后一次修改时间 **/
	private Date updateDate;
	/** 修改人 **/
	private String editor;
	/** 创建人 **/
	private String creator;

	/** 权限过滤 **/
	private String depCode;
	private String userCode;

	/*** 流程实例ID **/
	private String processinstanceid;
	/*** 流程状态 **/
	private Integer processState;
	/*** 流程Key **/
	private String processKey;
	/*** 节点id **/
	private String processId;
	/*** 节点名称 **/
	private String processName;
	/*** 业务流水号 **/
	private String businessKey;

	/** 任务ID **/
	private transient String taskId;
	/** 审批意见 **/
	private transient String auditOpinion;
	/** 审批状态 **/
	private transient Integer auditState;

	public ProcessEntity() {
	}

	@Id
	@GeneratedValue(generator = "generator")
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return StringUtil.isEmpty(id) ? null : id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(updatable = false)
	public Date getCreateDate() {
		return createDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public String getEditor() {
		return editor;
	}

	public void setEditor(String editor) {
		this.editor = editor;
	}

	@Column(updatable = false)
	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	@Column(name = "depCode", length = 32)
	public String getDepCode() {
		return depCode;
	}

	public void setDepCode(String depCode) {
		this.depCode = depCode;
	}

	@Column(name = "userCode", length = 32)
	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	public String getProcessinstanceid() {
		return processinstanceid;
	}

	public void setProcessinstanceid(String processinstanceid) {
		this.processinstanceid = processinstanceid;
	}

	@Column(name = "PROCESS_STATE")
	public Integer getProcessState() {
		return processState;
	}

	public void setProcessState(Integer processState) {
		this.processState = processState;
	}

	@Column(name = "PROCESS_KEY")
	public String getProcessKey() {
		return processKey;
	}

	public void setProcessKey(String processKey) {
		this.processKey = processKey;
	}

	@Column(name = "PROCESS_NAME")
	public String getProcessName() {
		return processName;
	}

	public void setProcessName(String processName) {
		this.processName = processName;
	}

	@Column(name = "BUSINESS_KEY")
	public String getBusinessKey() {
		return businessKey;
	}

	public void setBusinessKey(String businessKey) {
		this.businessKey = businessKey;
	}

	@Column(name = "PROCESS_ID")
	public String getProcessId() {
		return processId;
	}

	public void setProcessId(String processId) {
		this.processId = processId;
	}

	@Transient
	public Integer getAuditState() {
		return auditState;
	}

	public void setAuditState(Integer auditState) {
		this.auditState = auditState;
	}

	@Transient
	public String getAuditOpinion() {
		return auditOpinion;
	}

	public void setAuditOpinion(String auditOpinion) {
		this.auditOpinion = auditOpinion;
	}

	@Transient
	public String getTaskId() {
		return taskId;
	}

	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}

}
